package com.bookmanage.dao;

import com.bookmanage.utils.DBUitls;

import java.sql.*;

public class RegisterConn {


    public static void exec(String username, String password) {
        try {
            Connection conn = DBUitls.getConn();

            String sql = "insert into userinfo values(?,?)";
            //预处理编译sql
            PreparedStatement pst = (PreparedStatement) conn.prepareStatement(sql);
            //设置数据库的两个参数
            pst.setString(1, username);
            pst.setString(2, password);
            pst.executeUpdate();

        } catch (SQLException e) {
            e.printStackTrace();
        }
    }
}